import { createRouter,createWebHashHistory } from "vue-router";
import Layout from '@/layout/index.vue'
const index = ()=> import("../layout/index.vue")
const Login = ()=>import("../views/Login/Login.vue")
const PersonalIndex = ()=>import("../views/person/index.vue")
const PersonalMessage = ()=>import("@/views/person/Massge.vue")
const AppIndex = ()=>import("@/views/app/index.vue")
const NotFound = ()=>import("@/views/404.vue")
const routes = [
    {
        path:"/index",
        name:"index",
        component:index
    },
    {
        path:'/',
        name:'Home',
        component:Layout,
        children:[
            {
                path:'login',
                name:'Login',
                component:Login
            },
            {
                path:'personal',
                name:'Personal',
                component:PersonalIndex,
                children:[
                    {
                        path:'massage',
                        name:'personalMessage',
                        component:PersonalMessage
                    },

                ]
            },
            {
                path:'app',
                name:'app',
                component:AppIndex
            },
            {
                path:'404',
                name:'NotFound',
                component:NotFound
            }
        ],
        
    },
    {
        path:'/:pathMatch(.*)*',
        name:'404',
        redirect:'/404'
    }
]

const router = createRouter({
    history:createWebHashHistory(),
    routes
})

export default router